#ifndef basicparser2_h__
#define basicparser2_h__

#include "basicparser.h"
#include "syntaxtree.h"
#include "tokenizer.h"

namespace CCompiler
{
    enum TinyNameType
    {
        ntVariable,
        ntFunction,
        ntStruct,
        ntArray,
    };

    extern std::map<std::string, TinyNameType> strToTNT;

    /* obsolete class BasicParser2 */
    class BasicParser2: public BasicParser
    {
        virtual SynExpression *parseIdentifier();
        std::map<std::string, TinyNameType> tinySymbolTable;
        SynExpression *parseOtherOps(SynExpression *expr, TinyNameType nt, bool skipCheck = false);
        SynExpression *parseFunction(SynExpression *expr);
        SynExpression *parseArray(SynExpression *expr);
        SynExpression *parseStruct(SynExpression *expr);
    public:
        BasicParser2(Tokenizer &tokenizer): BasicParser(tokenizer) {}
        SynExpression *parseExpression2();
    };
}

#endif // basicparser2_h__